﻿using Microsoft.AspNetCore.Http;
using Polly;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace netcore_comm.Middleware
{
    public class BrowerMiddleware
    {
        private readonly IBrowersCheck _browersCheck;
        private readonly RequestDelegate _context;
        public BrowerMiddleware(IBrowersCheck browersCheck, RequestDelegate context)
        {
            _browersCheck = browersCheck;
            _context = context;
        }

        public async Task InvokeAsync(HttpContext httpContext)
        {
            this._browersCheck.CheckBrower(httpContext);
            await Console.Out.WriteLineAsync("Check");
            await _context(httpContext);
        }
    }
}
